using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace SPTraceView.Model
{
    internal static class SPSafeHelper
    {
        static SPSafeHelper()
        {
            try
            {
                Type type = Assembly.GetExecutingAssembly().GetType("SPTraceView.Model.SPUnsafeHelper");
                object unsafeHelper = Activator.CreateInstance(type);

                PropertyInfo pi = type.GetProperty("LocalFarmId", BindingFlags.Instance | BindingFlags.NonPublic);
                s_LocalFarmId = (Guid)pi.GetValue(unsafeHelper, null);
                
            }
            catch (Exception)
            { }
        }

        private static Guid s_LocalFarmId = Guid.Empty;

        public static Guid LocalFarmId
        {
            get { return s_LocalFarmId; }
        }
    }
}
